/*
 * Filename:    HcpmsPhraseUtil.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014-12-8
 */
package com.paic.mhis.hcpms.itextpdf.web.util;

import com.itextpdf.text.Chunk;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Phrase;

public class HcpmsPhraseUtil {
	public static Phrase createPhraseTitle(Font font, String text) {
		Phrase phrase = new Phrase(HcpmsChunkUtil.createChunkText(font, text));
		phrase.setFont(font);
		phrase.setLeading(Element.ALIGN_CENTER);
		return phrase;
	}

	public static Phrase createPhraseText(Font font, String text) {
		Phrase phrase = new Phrase(HcpmsChunkUtil.createChunkText(font, text));
		phrase.setFont(font);
		return phrase;
	}

	public static Phrase createPhraseText(Font font, Chunk chunk) {
		Phrase phrase = new Phrase(chunk);
		if (font != null) {
			phrase.setFont(font);
		}
		phrase.setLeading(Element.ALIGN_LEFT);
		return phrase;
	}
}
